home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / program / swagd_f.zip / EGAVGA.SWG / 0160_ET4000 video card.pas < prev    next >
Pascal/Delphi Source File  |  1995-03-03  |  1KB  |  77 lines

  1. {
  2.  HK> I have one little question: how do I program my ET4000
  3.  HK> graphics card in SVGA modes??? Without using some sort of
  4.  HK> BGI or unit!
  5.  
  6. Check this:
  7.  
  8. >--- cut here
  9. }
  10. program tsenglabs_et4000_640x480x256_mode;
  11. { Direct screen writing in SuperVGA mode 640x480x256 on a TsengLabs ET4000 }
  12. { By Bas van Gaalen, Holland, PD }
  13. uses crt;
  14. var x,y:word; i,page:byte;
  15.  
  16. procedure setvideo(md:word); assembler;
  17. { 02dh - 630x350
  18.   02eh - 640x480
  19.   02fh - 640x400 }
  20. asm
  21.   mov ax,md
  22.   int 10h
  23. end;
  24.  
  25. procedure setpal(col,r,g,b : byte); assembler;
  26. asm
  27.   mov dx,03c8h
  28.   mov al,col
  29.   out dx,al
  30.   inc dx
  31.   mov al,r
  32.   out dx,al
  33.   mov al,g
  34.   out dx,al
  35.   mov al,b
  36.   out dx,al
  37. end;
  38.  
  39. procedure writescreen; assembler;
  40. asm
  41.   mov es,sega000
  42.   mov x,0
  43.   mov y,0
  44.  @l1:
  45.   mov ax,y
  46.   mov dx,640
  47.   mul dx
  48.   add ax,x
  49.   adc dx,0
  50.   mov di,ax
  51.   cmp dl,page
  52.   je @skip
  53.   mov page,dl
  54.   mov al,dl
  55.   mov dx,03cdh
  56.   out dx,al
  57.  @skip:
  58.   mov ax,x
  59.   add ax,y
  60.   mov [es:di],al
  61.   inc y
  62.   cmp y,480
  63.   jne @l1
  64.   mov y,0
  65.   inc x
  66.   cmp x,640
  67.   jne @l1
  68. end;
  69.  
  70. begin
  71.   setvideo($2e);
  72.   for i:=1 to 255 do setpal(i,255-i div 4,255-i div 4,30);
  73.   writescreen;
  74.   repeat until keypressed;
  75.   textmode(lastmode);
  76. end.
  77.